*  FILE NAME: INVADJUS.PRG
*  BY: NURJADI PURNAMA
*  DATE: January 25, 1993
*  DESC:
*  CALLED BY:
*  DATA FILES:

set proc to sospro
SET PROC TO BOXPROC
set proc to ADDREPRO
do start

dr1='N:'
DR='N:'
F1='PATIENT'
F2='REVENUE1'

SELE 1
SET EXCLU OFF
USE &DR1&F1 INDE &DR1&F1
SELE 2
SET EXCLU OFF
USE &DR&F2
PL1=0
DO WHILE .T.
   SET COLO TO BG+/B
   CLEAR
   DO ADDRESSV
*   DO ADDRCHAN
   DO BOXT WITH 4,3,"CHECK REPLACEMENT OF INVOICE VOID",'BG+','GR',.F.,.T.
   SET COLO TO BG+/B,W+/N
   STORE SPACE(16) TO PAYON,PAYNBER
   SET COLO TO BG+/B,W+/N
   @  9, 3 CLEAR TO 19,68
   NOFT=SPACE(5)
   @ 12,3 SAY 'INVOICE NO.  : 'GET NOFT PICT '@!'
   READ
   IF LASTKEY()=27 .OR. NOFT=SPACE(5)
      RETURN
   ENDIF
   SELE 2
   SET EXCLU OFF
   USE &DR&F2
   LOCATE FOR INV_NBER=NOFT
   IF .NOT. FOUND()
      LOOP
   ENDIF
   PATCOD=PAT_FILCOD
   PAYMOD1=PAY_MODE
   IF HEALTHLINE
      KET='HEALTHLINE'
   ELSE
      KET=SPACE(10)
   ENDIF
   SET COLO TO BG+/B,W+/N
   @ 8,40 SAY KET
   @ 10,3 SAY 'PATIENT CODE : '+PATCOD
   @ 10,40 SAY 'PATIENT NAME    : '+ ALLTRIM(PAT_NAME)+' '+ALLTRIM(PAT_F_NAME)
   @ 12,40 SAY 'DATE OF INVOICE : '+DTOC(DATE_VISIT)
   IF PAY_MODE='CARD'
      @ 14,3 SAY 'PAYMENT MODE : '+ALLTRIM(PAY_MODE)+' '+ALLTRIM(PAY_ON)
      @ 14,40 SAY 'CARD NUMBER     : '+PAY_NBER
   ELSE
      @ 14,3 SAY 'PAYMENT MODE : '+ALLTRIM(PAY_MODE)
   ENDIF
   @ 16,40 SAY 'INVOICE AMOUNT  : '+TRANS(TOTAL_FEE,'##,###,###')
   @ 16,3 SAY 'CASH PAYMENT : '+TRANS(TOTAL_CASH,'##,###,###')
   @ 18,40 SAY 'CREDIT VOUCHER  : '+TRANS(TOTAL_CRED,'##,###,###')
   @ 18,3 SAY 'HEALTHLINE   : '+TRANS(TOTAL_HL,'##,###,###')
   SET COLO TO GR+/B,W+/N
   SET COLO TO BG+/B,W+/N
   TCAS=TOTAL_CASH
   TCRE=TOTAL_CRED
   PIL1=1
   DO BOX2 WITH 21,0,"DO YOU WANT TO :","GET ANOTHER INVOICE","QUIT",'GR+','RB','GR+','R',PIL1,.F.,.T.
   IF PIL1=2 .OR. LASTKEY()=27
      CLOSE ALL
      RETURN
   ENDIF
ENDDO

*Formatted by: Herman T Ver. 7.1  on March 29, 1996.
